package com.damao.controller;

import com.damao.Service.RedisService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author huyongxing
 * @email huyongxing@qihaiyun.com
 * @date 2018/6/7 15:50
 */
@RestController
public class DemoController {

    @Autowired
    private RedisService redisService;

    private Logger logger = LoggerFactory.getLogger(DemoController.class);


    @GetMapping("/set")
    public void setObject() {
        redisService.set("key0001", "value0001");
    }


    @GetMapping("/get")
    public Object getObject() {
        logger.error("xxxx","eeeeeeeeeeeeeeeeeeeeeeeee");
        return redisService.get("key0001");
    }
}
